import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'

Vue.use(Router)

const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

export default new Router({
  routes: [
    {
      path: '/',
      alias: '/home',
      component: () => import('@/views/Home.vue')
    },
    {
      path: '/category',
      component: () => import('@/views/Category.vue')
    },
    {
      path: '/detail/',
      component: () => import('@/views/Detail.vue')
    },
    {
      path: '/play',
      component: () => import('@/views/Play.vue')
    },
    {
      path: '*',
      meta: {
        title: '404'
      },
      component: () => import('@/views/404.vue')
    }
    // {
    //   path: '/',
    //   name: 'HelloWorld',
    //   component: HelloWorld
    // },
  ]
})
